msg logo
go icon

كيف ترسل رسالة واتساب باستخدام ال api go

أرسل رسالة واتساب بسهولة باستخدام ال api إبدأ خلال دقائق

الكود الكامل
package main import ( "bytes" "encoding/json" "io/ioutil" "net/http" ) func main() { data := map[string]interface{}{ "to": []string{"+1234567890", "+0987654321"}, "message": "Hello from MSG!", // "token": "YOUR_API_TOKEN", // Optional, gives full access } jsonData, _ := json.Marshal(data) req, _ := http.NewRequest("POST", "https://api.sendmsg.dev/message/batch", bytes.NewBuffer(jsonData)) client := &http.Client{} resp, _ := client.Do(req) body, _ := ioutil.ReadAll(resp.Body) defer resp.Body.Close() }
لغات أخرى متاحة